home *** CD-ROM | disk | FTP | other *** search
/ LeeAnne Interactive / Leeanne Interactive.iso / elements / fashion.dir / 00012_Script_Go to Movie < prev    next >
Text File  |  1999-07-28  |  2KB  |  70 lines

  1. -- Movie      Go to/Play
  2.  
  3.  
  4. -- behavior library version 1.1
  5.  
  6. -- Either 'goes to' a movie or 'plays' a movie.  Goto won't return and play returns when the
  7. -- movie runs into 'playdone' in a lingo handler.  Use the Play Done behavior in the called
  8. -- movie to create this action.
  9. -- 
  10. -- also functions through lingo by handling message 'initGotoMovie', 
  11. -- for example if this behavior was assigned to sprite 5, use
  12. -- sendsprite 5, #initGotoMovie
  13.  
  14. property  movieName, playMode, whichEvent
  15.  
  16. on initGotoMovie me
  17.   init me
  18. end
  19.  
  20. on mouseUp me
  21.   if whichEvent = #mouseup    then init me
  22. end
  23.  
  24. on prepareFrame me
  25.   if whichEvent = #prepareframe then init me
  26. end
  27.  
  28. on exitFrame me
  29.   if whichEvent = #exitframe  then init me
  30. end
  31.  
  32. on init me
  33.   set the movieName of me = get_filename( movieName )
  34.   case ( playMode ) of:
  35.     #"Go to":
  36.       go to movie movieName
  37.     #"Play and Return":
  38.       play movie movieName
  39.   end case
  40. end
  41.  
  42.  
  43.  
  44. ---
  45.  
  46. on get_filename f_name
  47.   -- don't force user to remember the extension
  48.   if NOT ( f_name contains ".dir" ) then
  49.     set f_name = f_name & ".dir"
  50.   end if
  51.   -- support relative pathnames
  52.   if (( f_name contains "/" ) OR       ( f_name contains "\" )) then
  53.     if ( NOT f_name contains ":" ) then
  54.       set f_name = the pathname & f_name
  55.     end if
  56.   end if
  57.   return( f_name )
  58. end
  59.  
  60. on getPropertyDescriptionList
  61.   
  62.   set p_list = [      #movieName: [ #comment:   "Movie:",                     #format:   #string,                    #default:   "       " ],       #playMode: [ #comment:   "Play Mode:",                     #format:   #symbol,                      #range: [ #"Go to", #"Play and Return" ],                    #default:   #"Go to" ],     #whichEvent: [ #comment:  "Initializing Event:",                     #format:   #symbol,                      #range: [ #MouseUp, #PrepareFrame, #ExitFrame, #InitGotoMovie ],                    #default:   #MouseUp ]                  ]
  63.   return p_list  
  64. end
  65.  
  66. on getBehaviorDescription
  67.   return "Plays a new Director movie in the same window." & RETURN & "ò Movie - Enter the file name of a movie to play." & RETURN & "ò Play Mode - Choose Play and Return to return to the current movie when the Playback Head reaches the end of the other movie or when the Play Done behavior is encountered. Choose Go To to play the other movie without returning to the current movie." & RETURN & "ò Initializing Event - Specify the event that triggers the behavior."
  68. end
  69.  
  70.